fix JSCore segmentation fault on 64-bit big endian systems
authorDebian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Tue, 1 Nov 2022 18:32:28 +0000 (18:32 +0000)
committerDmitry Shachnev <mitya57@debian.org>
Tue, 1 Nov 2022 18:32:28 +0000 (18:32 +0000)
commit56e1c6240dddf9f4e59b5801158b285edf20aad2
treee4fa0f0982366225f06bb2c5e65a5db81b76c9c8
parent07ae43c28399ed435d4c898575853e037d8169fe
fix JSCore segmentation fault on 64-bit big endian systems

Origin: backport, https://github.com/webkit/webkit/commit/3fdde71c7d95d758
Reviewed-by: Frank Heimes <frank.heimes@canonical.com>
Last-Update: 2021-11-24

In CodeBlock.cpp the code preparing the operands of op_get_from_scope writes
the property offset as pointer size (hence 64 bit) value:

2141: instructions[i + 6].u.pointer = reinterpret_cast<void*>(op.operand);

while the same slot is accessed later by the jitted code as 32 bit integer:

macro getProperty(slow)
   loadisFromInstruction(6, t1)

This fails on big endian targets since the integer access takes the higher
part of the 64 bit value.

Gbp-Pq: Name jscore_big_endian.diff
Source/JavaScriptCore/llint/LowLevelInterpreter64.asm